<template>
	<!-- 客户新增 -->
	<view class="container">
		<view class="collectionBox">
			<uni-forms ref="form" :modelValue="formData" label-width="80px">
				<uni-forms-item class="formItem" label="选择收款账户" name="collectionAccount" :rules="$rules.handle.collectionAccount">
					<uni-data-select :clear="false" style="background-color: #fff;border-radius: 10rpx;" v-model="formData.collectionAccount"
						:localdata="CollectionAccountOptions" @change="changeSearchSelect" placeholder="请选择收款账户"></uni-data-select>
				</uni-forms-item>
				<view class="submitButton">
					<button round type="primary" @click="submitButton">提交</button>
				</view>
			</uni-forms>
		</view>
		
	</view>
</template>

<script>
	export default{
		data(){
			return{
				// 收款账户下拉数据
				CollectionAccountOptions:[
					{
							value: '1',
							text: "6217000900001219789"
						},
						{
							value: '2',
							text: "62172346545329789"
						},
						{
							value: '3',
							text: "62324564323129789"
						},	
				],
				// 表单绑定
				formData:{
					// 收款账户
					collectionAccount:"",
				},
			}
		},
		methods:{
			// 下拉搜索条件事件
			changeSearchSelect(e) {
				console.log('收款账户下拉', e)
			
			},
			// 表单提交
			submitButton(){
				this.$refs.form.validate().then(res => {
					console.log('是否通过了', res)
					// this.$http('post', '/Base_Manage/Base_User/SaveUserModel', {
					// 	...this.formData,
					// 	UserPhone: this.formData.Phone
					// }).then(res => {
					// 	if (res.Success) {
					// 		uni.showToast({
					// 			icon: 'none',
					// 			title: '注册成功'
					// 		})
					// 		setTimeout(() => {
					// 			uni.redirectTo({
					// 				url: '/pages/Login/Login'
					// 			})
					// 		}, 1000)
					// 	} else uni.showToast({
					// 		icon: 'none',
					// 		title: res.Msg
					// 	})
					// })
				}).catch(err => {
					console.log(err);
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.container{
		height: 100%;
		background-color: #fff;
			background-image: url(/static/background.png);
		
		.collectionBox{
			padding-left: 20rpx;
			padding-right: 20rpx;
			.formItem{
				border-bottom: 1px solid #ddd;
				padding-bottom: 20rpx;
			}
			.submitButton{
				position: fixed;
				padding-bottom: calc(constant(safe-area-inset-bottom) + 20rpx);
				padding-bottom: calc(env(safe-area-inset-bottom) + 20rpx);
				bottom: 20rpx;
				width: 100%;
				button{
				  margin-right: 40rpx;
				  height: 80rpx;
				  border-radius: 10rpx;
				  line-height: 80rpx;
				  font-size: 28rpx;
				  color: #FFFFFF;
				  font-weight: bold;
				}
			}
		}
		
	}
</style>